package com.hxkj.client.service;


import com.hxkj.domain.po.*;
import com.platform.common.domain.result.ParameterDataStruct;
import com.platform.common.domain.result.ResultDataStruct;
import com.platform.common.domain.result.ResultMessageStruct;
import com.platform.common.domain.result.ResultPageStruct;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;


/**
 * @InterfaceName AuthUserServiceClient 用户对外接口API
 * @Description TODO
 * @Author Mr.zheng
 * @Date 2018/5/23 18:11
 * @Version 1.0
 */
@FeignClient(name = "cms-management")
@Service
public interface AuthUserServiceClient {

    /**
     * @author Mr.zheng
     * @Description getlist 获取用户列表
     * @Date 15:09 2018/5/19
     * @Param [user] 用户信息
     * @return java.util.concurrent.Callable<com.platform.common.domain.result.ResultPageStruct<com.hxkj.domain.po.User>>
     **/
    @RequestMapping(value = "/user/getlist", method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultPageStruct<AllocationAuthUser> getUserBySlave(@RequestBody ParameterDataStruct<AuthUser> parameterDataStruct ) throws Exception ;
    /**
     * @author Mr.zheng
     * @Description get  获取用户信息
     * @Date 15:20 2018/5/19
     * @Param [uid]  用户ID
     * @return java.util.concurrent.Callable<com.hxkj.domain.po.User> 用户信息
     **/
    @RequestMapping(value = "/user/get", method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultDataStruct getAuthUser(@RequestBody AuthUser userAuth) throws Exception ;

    /**
     * @author Mr.zheng
     * @Description save 新增用户
     * @Date 15:19 2018/5/19
     * @Param [user]
     * @return void
     **/
    @RequestMapping(value = "/user/save", method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultMessageStruct saveUser(@RequestBody AuthUser authUser) throws Exception ;

    /**
     * @author Mr.zheng
     * @Description modify 修改用户
     * @Date 11:15 2018/5/21
     * @Param [authUser]
     * @return com.platform.common.domain.result.ResultMessageStruct
     **/
    @RequestMapping(value="/user/modify",method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultMessageStruct updateAuthUser(@RequestBody AuthUser authUser) throws Exception;

    /**
     * @author Mr.zheng
     * @Description remove 删除用户信息
     * @Date 13:56 2018/5/22
     * @Param [authUser]
     * @return java.util.concurrent.Callable<com.platform.common.domain.result.ResultMessageStruct>
     **/
    @RequestMapping(value = "/user/remove",method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultMessageStruct deleteAuthUser(@RequestBody AuthUser authUser ) throws Exception;

    /**
     * 根据用户查找对应的角色
     * @param authRole
     * @return
     * @throws Exception
     */

    @RequestMapping(value = "/user/role/getlist", method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultDataStruct<AllocationUser> getRoleAssignUser(@RequestBody AuthRole authRole) throws Exception;

    /**
     * 添加用户到角色
     * @param authRole
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/user/addusertorole", method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultMessageStruct addUsertToRole(@RequestBody AuthRole authRole) throws Exception;

    /**
     * @author Mr.zheng
     * @Description saveUserSite 添加用户名下站点删除修改
     * @Date 19:26 2018/5/21
     * @Param [uid, siteIds]  用户id 和站点id拼接的字符串
     * @return java.util.concurrent.Callable<java.lang.Integer>
     **/
    @RequestMapping(value = "/user/setsite",method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultMessageStruct saveUserSite(@RequestBody AuthUser authUser) throws  Exception;

    /**
     * @author Mr.zheng
     * @Description getUserSite 根据用户ID查询其管理的站点
     * @Date 17:46 2018/5/21
     * @Param [uid] 用户ID
     * @return java.util.concurrent.Callable<com.platform.common.domain.result.ResultPageStruct<com.hxkj.domain.po.Site>>
     **/
    @RequestMapping(value = "/user/getsite",method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultDataStruct<AllocationSite>  getUserSite(@RequestBody AuthUser authUser) throws Exception;

    /**
     * 获取所有自媒体角色的用户id集合
     */

    @RequestMapping(value = "/user/getagentlist",method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultPageStruct<AuthUserAgent> getAgentList(@RequestBody ParameterDataStruct<AuthUserAgent> parameterDataStruct) throws Exception;


    /**
    * @author Mr.zheng
    * @Description getAuthRoleByUser
    * @Date 8:59 2018/6/14
    * @Param [authUser]
    * @return com.platform.common.domain.result.ResultDataStruct<com.hxkj.domain.po.AuthRole>
    **/
    @RequestMapping(value = "/user/getrolebyuser", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<AuthRole> getAuthRoleByUser(@RequestBody AuthUser authUser) throws Exception;


    /**
     * @author Mr.zheng
     * @Description getAuthRoleByUser
     * @Date 8:59 2018/6/14
     * @Param [authUser]
     * @return com.platform.common.domain.result.ResultDataStruct<com.hxkj.domain.po.AuthRole>
     **/
    @RequestMapping(value = "/user/getsitebyid", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    ResultDataStruct<Site> getSiteById(@RequestBody Site site) throws Exception;


    /**
     * @author Mr.zheng
     * @Description modify 用户重置密码
     * @Date 11:15 2018/5/21
     * @Param [authUser]
     * @return com.platform.common.domain.result.ResultMessageStruct
     **/
    @RequestMapping(value="/user/modifypassword",method = RequestMethod.POST,consumes  ="application/json;charset=UTF-8")
    ResultMessageStruct updateAuthUserPassword(@RequestBody AuthUser authUser) throws Exception;
}
